package edu.sctu.practice.class02.hujie.cgs.assign02;

/**
 * Created by user14 on 2015/10/8.
 */
public class Circle {

    double radius;
    private final double PI = 3.1415926;
    static int numOfObjects;

    //静态方法
    public Circle(double radius) {

        this.radius = radius;
        numOfObjects++;

    }

    //求圆面积
    public void seekArea() {

        float area = (float) (3.14 * radius * radius);
        System.out.println("其半径为：" + radius);
        System.out.println("面积为：" + area);

    }

    public void getNumber() {
        System.out.println("运行次数为：" + numOfObjects);
    }
    public static void printCircle() {
        Circle c = new Circle(2.0);
        c.seekArea();
        c.getNumber();

    }
}

